<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
	<head>
		<meta http-equiv="content-type" content="text/html; charset=utf-8">
		<!-- css for button combobox -->
		<link rel="stylesheet" href="../../webroot/css/demos.css">
		<link rel="stylesheet" href="../../webroot/css/themes/base/jquery.ui.all.css">
		<style type = "text/css">
			.autocomplete-button {
				position:relative;
				top:6px;
			}​
		</style>
	</head>
	<body>		
		<script type="text/javascript">
        $(document).ready(function () {
			$( "#combobox" ).combobox();
            alert('JQuery is succesfully included');
			
        });
		</script>
	
		<?php
			echo $this->Html->link('Thêm HocSinh', array('controller' => 'hocsinhs', 'action' => 'add'));
		
			$lophoc = array();
			foreach($lops as $lop){
				$lophoc[$lop['Lop']['MaLop']] = $lop['Lop']['TenLop'];
			}
			$truonghoc = array();
			foreach($truongs as $truong){
				$truonghoc[$truong['Truong']['MaTruong']] = $truong['Truong']['TenTruong'];
			}
			$khoihoc = array();
			foreach($khois as $khoi){
				$khoihoc[$khoi['Khoi']['MaKhoi']] = $khoi['Khoi']['TenKhoi'];
			}
			echo $this->Form->create('Hocsinh',array('id'=>'HocsinhSearchForm', 'action'=>'index'));
		?>
		<table>
			<tr>			
				<?php echo $this->Form->input('MaTruong', array('id'=>'cbMaTruong','type' => 'select', 'label'=>'Chọn trường','options' => $truonghoc, 'selected' => $currentIndexs['MaTruong'])); ?>
			</tr>
			<tr>
				<?php echo $this->Form->input('MaKhoi', array('id'=>'cbMaKhoi','type' => 'select', 'label'=>'Chọn khối','options' => $khoihoc, 'selected' => $currentIndexs['MaKhoi'])); ?>
			</tr>
			<tr>
				<?php echo $this->Form->input('MaLop', array('id'=>'cbMaLop','type' => 'select', 'label'=>'Chọn lớp', 'options' => $lophoc, 'selected' => $currentIndexs['MaLop']));?>		
			</tr>
			<tr>
				<?php echo $this->Form->end(array(
														'id'=>'SubmitHocsinhSearchForm',
														'label'=>'Xem danh sách học sinh')); ?>
			</tr>
		</table>
			
			
		
		<table>
			<tr>
				<th>Mã học sinh</th>
				<th>Họ học sinh</th>
				<th>Tên học sinh</th>
				<th>Ngày Sinh</th>
				<th>Nơi Sinh</th>
				<th>Địa Chỉ</th>
				<th>Họ Tên Cha</th>
				<th>Họ Tên Mẹ</th>
				<th>Thao tác</th>
			</tr>
			<!-- Here's where we loop through our $posts array, printing out post info -->

		<?php foreach ($hocsinhs as $hocsinh): ?>
			<tr>
				<td><?php echo $hocsinh['Hocsinh']['MaHS']; ?></td>
				<td><?php echo $hocsinh['Hocsinh']['HoHS']; ?></td>
				<td><?php echo $hocsinh['Hocsinh']['TenHS']; ?></td>
				<td><?php echo $hocsinh['Hocsinh']['NgaySinh']; ?></td>
				<td><?php echo $hocsinh['Hocsinh']['NoiSinh']; ?></td>
				<td><?php echo $hocsinh['Hocsinh']['DiaChi']; ?></td>
				<td><?php echo $hocsinh['Hocsinh']['HoTenCha']; ?></td>
				<td><?php echo $hocsinh['Hocsinh']['HoTenMe']; ?></td>
				<td><?php echo $this->Form->postLink(
						'Xóa',
						array('controller'=>'hocsinhs', 'action' => 'delete', $hocsinh['Hocsinh']['MaHS']),
						array('confirm' => 'Bạn có chắc muốn xóa học sinh: '.$hocsinh['Hocsinh']['HoHS'].' '.$hocsinh['Hocsinh']['TenHS']));
					?>
				</td>
				<td><?php echo $this->Html->link('Sửa', array('controller'=>'hocsinhs', 'action' => 'edit', $hocsinh['Hocsinh']['MaHS']));?></td>
			</tr>
		<?php endforeach; ?>

</table>
	</body>
</html>